

<!--
All rights Reserved, Designed By www.youyacao.com
@Description:支付配置
@author:成都市一颗优雅草科技有限公司
@version V4.2
注意：本前端源码遵循 MIT开源协议本内容仅限于个人参考，禁止用于其他的商业用途
需要商业用途或者定制开发等可访问songshu.youyacao.com   联系QQ:422108995 23625059584
开源gitee地址：https://gitee.com/youyacao/songshu-video-page
 -->

<template>
  <div>
    <div class="crumbs">
      <el-breadcrumb separator="/">
        <el-breadcrumb-item>
          <i class="el-icon-lx-calendar"></i> 支付配置
        </el-breadcrumb-item>
        <el-breadcrumb-item>支付配置</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="container">
      <div class="form-box">
        <el-form ref="form" :model="form" label-width="140px">
          <el-form-item label="商户ID">
            <el-input v-model="form.pay_memberid"></el-input>
          </el-form-item>
          <el-form-item label="商户密匙">
            <el-input v-model="form.pay_key"></el-input>
          </el-form-item>
          <el-form-item label="提交地址">
            <el-input v-model="form.pay_submit_url"></el-input>
          </el-form-item>
          <el-form-item label="派特支付用户ID">
            <el-input v-model="form.pay_pet_user_id"></el-input>
          </el-form-item>
          <el-form-item label="派特支付通讯密钥">
            <el-input v-model="form.pay_pet_key"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="onSubmit">提交</el-button>
            <el-button>取消</el-button>
          </el-form-item>
        </el-form>
      </div>
    </div>
  </div>
</template>

<script>
import qs from 'Qs'
export default {
    name: 'baseform',
    data() {
        return {
            form: {
            }
        };
	},
	created(){
		this.getData();
	},
    methods: {
		getData(){
			this.$api.config.get({}).then((res)=>{
				this.form = res.data;
			});
		},
		onSubmit() {
			var data = [];
			for(let item in this.form){
				data[`config[${item}]`]=this.form[item];
			}
			console.log(data);
			this.$api.config.set(qs.stringify(data)).then((res)=>{
				console.log(res.data);
			});
            this.$message.success('提交成功！');
        }
    }
};
</script>
